# from utils.game.info import GameInfo
# import asyncio
# import time

# async def monitor_game(game_info):
#     """监控游戏信息"""
#     last_info = game_info.to_dict()
    
#     print(f"[{time.strftime('%H:%M:%S')}] 开始监控游戏信息...")
#     print(f"窗口句柄: {last_info['hwnd']}")
#     print(f"游戏时代: {last_info['当前时代']}")
#     print(f"初始血量: {last_info['roles']['HP']}%")
#     print(f"初始魔法: {last_info['roles']['MP']}%")
    
#     while True:
#         try:
#             # 更新信息
#             await game_info.update_roles_info()
#             current_info = game_info.to_dict()
            
#             # 检查血量变化
#             if current_info['roles']['HP'] != last_info['roles']['HP']:
#                 print(f"[{time.strftime('%H:%M:%S')}] 血量: {current_info['roles']['HP']}%")
            
#             last_info = current_info
#             await asyncio.sleep(0.1)  # 控制更新频率
            
#         except Exception as e:
#             print(f"监控错误: {e}")
#             await asyncio.sleep(1)  # 出错时等待较长时间

# if __name__ == "__main__":
#     try:
#         asyncio.run(monitor_game(GameInfo(395592)))
#     except KeyboardInterrupt:
#         print("\n程序已停止")


from core.skill import SkillCycle

skill_cycle = SkillCycle("蜀山")
skill_cycle.detect_target(True)  # 模拟目标存在
skill_cycle.start()
from utils import GlobalOcr

# ocr_manager = GlobalOcr()

# hwnd = 395592
# img = ocr_manager.capture_and_recognize(
#     hwnd=hwnd,
#     start_point=(120, 103),  # 这里需要根据实际UI位置调整
#                 size=(35, 16),
#                 debug=True,
#     confidence_threshold=0.01,
# )
# print(img)
